Learn R Programming

bnlearn (version 3.1)

bn.fit class: The bn.fit class structure

Description

The structure of an object of the bn.fit S3 class.

Arguments

Details

An object of class bn.fit is a list whose elements correspond to the nodes of the Bayesian network. If the latter is discrete (i.e. the nodes are multinomial random variables) each node has class bn.fit.dnode and contains the following elements:

  • node: the label of the node.
  • parents: the labels of the parents of the node.
  • children: the labels of the children of the node.
  • prob: the conditional probability table of the node given its parents.

If on the other hand the network is continuous (i.e. the nodes are Gaussian random variables) each node has class bn.fit.gnode and contains the following elements:

  • node: the label of the node.
  • parents: the labels of the parents of the node.
  • children: the labels of the children of the node.
  • coefficients: the linear regression coefficients of the parents against the node.
  • residuals: the residuals of the linear regression, that is response minus fitted values.
  • fitted.values: the fitted mean values of the linear regression.
  • sd: the standard deviation of the residuals.

Furthermore, Bayesian network classifiers store the label of the training node in an additional attribute named training.